import { defineConfig, presetAttributify, presetUno } from 'unocss'
import presetRemToPx from '@unocss/preset-rem-to-px'

export default defineConfig({
  presets: [presetUno(), presetAttributify(), presetRemToPx({ baseFontSize: 12 })],
  rules: [
    [/^border-(\d+)$/, ([, d]) => ({ 'border-width': `${d}px` })],
    [
      /^\[(.+)\]$/,
      ([, value]) => {
        if (value.includes('calc(')) {
          return { content: `'${value}'` }
        }
      }
    ]
  ],
  shortcuts: [['wh-full', 'w-full h-full']],
  theme: {
    colors: {
      primary: 'rgba(var(--primary-color))',
      dark: '#18181c',
      light_border: '#efeff5',
      dark_border: '#2d2d30'
    }
  }
})
